#include "Core/RefCountedObject.h"


BEGIN_GLSX_NAMESPACE


RefCountedObject::RefCountedObject(): _counter(1)
{
}


RefCountedObject::~RefCountedObject()
{
}

inline int RefCountedObject::referenceCount() const
{
	return _counter.value();
}


inline void RefCountedObject::duplicate() const
{
	++_counter;
}


inline void RefCountedObject::release() const
{
	if (--_counter == 0) delete this;
}


END_GLSX_NAMESPACE
